import sys,math,os
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
class StatusDemo(QMainWindow):
    def __init__(self,parent=None):
        super(StatusDemo,self).__init__(parent)
        bar=self.menuBar()
        file=bar.addMenu("File")
        file.addAction("show")
        file.triggered.connect(self.processtriggered)
        self.setCentralWidget(QTextEdit())
        self.statusBar=QStatusBar()
        self.setWindowTitle("状态栏")
        self.setStatusBar(self.statusBar)
    def processtriggered(self,q):
        if (q.text()=="show"):
            self.statusBar.showMessage(q.text()+"菜单选项被点击了",6000)


if __name__ == '__main__':
    app=QApplication(sys.argv)
    demo=StatusDemo()
    demo.show()
    sys.exit(app.exec_())
